#include<bits/stdc++.h>
#define int long long
using namespace std;
void fileopen(string s)
{
    freopen((s+".in").c_str(),"r",stdin);
    freopen((s+".out").c_str(),"w",stdout);
}
int a[100007],s[100007];
signed main()
{
    fileopen("duel");
    int n,i,x;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>x;
        a[x]++;
    }
    int ans=n;
    for(i=1;i<=100000;i++)
    {
        s[i]=a[i]+s[i-1];
        if(s[i-1]<=a[i])
        {
            s[i]-=s[i-1];
            ans-=s[i-1];
        }
        else
        {
            s[i]-=a[i];
            ans-=a[i];
        }
    }
    cout<<ans;
    return 0;
}
